<?php

// use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Jialeo\LaravelSchemaExtend\Schema;
class CreateTopicsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('topics', function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->increments('id');
            $table->Integer('user_id')->comment('用户id');
            $table->Integer('category_id')->comment('分类id');
            $table->Integer('reply_count')->comment('评论数');
            $table->Integer('view_count')->comment('点击数');
            $table->Integer('last_reply_user_id')->comment('最后回复用户');
            $table->string('title')->comment('标题');
            $table->text('body')->comment('内容');
            $table->Integer('order')->comment('排序');
            $table->string('excerpt')->comment('话题摘录');
            $table->string('slug')->comment('title 翻译');
            $table->timestamps();

            $table->comment = '话题表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('topics');
    }
}
